package functionInterface;

import java.util.function.Predicate;

public class PredicateTest {

    /**
     * 测试Predicate的negate、or、and三个默认方法
     * @param args
     */
    public static void main(String[] args) {

        Predicate<Boolean> result = Boolean::booleanValue;
        result = result.or(result.negate());
        System.out.println(result.test(false));

        Predicate<Boolean> result2 = Boolean::booleanValue;
        result2 = result2.and(result2.negate());
        System.out.println(result2.test(true));
    }
}
